﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="search-userbyvehicleno.aspx.cs" 
 EnableEventValidation="false" Inherits="User_search_userbyvehicleno" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager runat="server" ID="smgrUser" EnablePartialRendering="true">
    </asp:ScriptManager>
    <div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td colspan="2">
                    <h1>
                        Search User by Vehicle Number</h1>
                </td>
            </tr>
            <tr id="trSearch" runat="server">
                <td>
                    <b>User Type</b> :
                    <asp:DropDownList ID="ddlUserType" runat="server">
                        <asp:ListItem Text="Online-Customer" Value="400"></asp:ListItem>
                        <asp:ListItem Text="Offline-Customer" Value="1001"></asp:ListItem>
                        <asp:ListItem Text="Provider" Value="300"></asp:ListItem>
                        <asp:ListItem Text="Site User" Value="200"></asp:ListItem>
                    </asp:DropDownList>
                    <b>Vehicle No</b> :
                    <asp:TextBox ID="txtVehicleNo" runat="server" Width="300px"></asp:TextBox>&nbsp;
                    <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Submit" Width="100px" />&nbsp;
                    <asp:Button ID="btnLogout" runat="server" Text="Log Out" OnClick="btnLogout_Click" Visible="false" />
                    <asp:Button ID="btnClear" runat="server" OnClick="btnClear_Click" Text="Clear" Width="100px"
                        Visible="false" />&nbsp;&nbsp;&nbsp;
                    <asp:Label runat="server" ID="lblRecordCount" Text=""></asp:Label>
                </td>
            </tr>
             <tr>
                <td colspan="2">
                    <asp:GridView ID="grvUser" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        GridLines="None" CellPadding="2" DataKeyNames="CEID" CssClass="admin_gridstyle" 
                        EmptyDataText="There are no data records to display." OnSelectedIndexChanged="grvUser_SelectedIndexChanged">
                        <FooterStyle />
                        <PagerStyle />
                        <Columns>
                            <asp:BoundField DataField="CEID" ItemStyle-Width="60px" HeaderText="ID" InsertVisible="False"
                                ReadOnly="True" SortExpression="CEID" />
                            <asp:BoundField ItemStyle-Width="120px" DataField="UserTypeDesc" HeaderText="User Type"
                                SortExpression="UserTypeDesc" ReadOnly="True" />
                            <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
                            <asp:BoundField DataField="SurName" ItemStyle-Width="225px" HeaderText="SurName"
                                SortExpression="SurName" />
                            <asp:BoundField DataField="Mobile" ItemStyle-Width="120px" HeaderText="Mobile No."
                                SortExpression="Mobile" />
                            <asp:BoundField DataField="Email" ItemStyle-Width="225px" HeaderText="Email" SortExpression="Email" />
                            <asp:BoundField DataField="AuthCode" ItemStyle-Width="150px" HeaderText="Password"
                                SortExpression="AuthCode" />
                            <asp:BoundField DataField="VehicleNo" ItemStyle-Width="110px" HeaderText="VehicleNo" SortExpression="VehicleNo" />
                            <asp:BoundField DataField="UsrTypeId" Visible="false" HeaderText="UsrTypeId" SortExpression="UsrTypeId" />
                            <asp:BoundField DataField="CreatedDate" DataFormatString="{0:dd/MM/yyyy hh:mm:ss tt}"
                                HeaderText="Register Date" SortExpression="CreatedDate" />
                            <%--<asp:CheckBoxField DataField="IsReject" HeaderText="Is Reject" />--%>
                            <asp:CommandField ShowSelectButton="True" />
                        </Columns>
                        <FooterStyle />
                        <PagerStyle />
                        <SelectedRowStyle BackColor="LightGray" />
                        <HeaderStyle CssClass="admin_gridheader" />
                        <EditRowStyle />
                        <AlternatingRowStyle CssClass="admin_gridodd" />
                        <RowStyle CssClass="admin_grideven" />
                    </asp:GridView>
                </td>
                <div style="display: none;">
                    <asp:TextBox ID="txtUserId" runat="server"></asp:TextBox>
                    <asp:TextBox ID="txtUserTypeId" runat="server"></asp:TextBox>
                </div>
            </tr>
            <td style="width: 100%;" colspan="2">
                <div id="divQuotes" runat="server" class="w45p left pad_r20px">
                    <div class="left">
                        <span class="h">
                            <asp:Label ID="lblHeader" runat="server" Text="User Quotes Details"></asp:Label></span></div>
                    <br />
                    <div class="pad_r20px font_13px">
                        <asp:Label ID="lblMessage" runat="server" Text="This option for CX Customer Users only."
                            Visible="false"></asp:Label></div>
                    <asp:GridView ID="grvQuotesCount" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        CellPadding="2" CssClass="admin_gridstyle" EmptyDataText="There are no data records to display."
                        GridLines="None" Width="75%" DataKeyNames="RefCEUserId,InsType" OnSelectedIndexChanged="grvQuotesCount_SelectedIndexChanged"
                        OnRowDataBound="grvQuotesCount_RowDataBound">
                        <FooterStyle />
                        <PagerStyle />
                        <Columns>
                            <asp:BoundField DataField="RefCEUserId" HeaderText="User ID" ReadOnly="True" />
                            <asp:BoundField DataField="InsType" HeaderText="Quote Type" ReadOnly="True" />
                            <asp:BoundField DataField="QuoteCount" HeaderText="No of Quotes" />
                            <asp:HyperLinkField DataNavigateUrlFields="QuoteUrl" Target="_blank" HeaderText="View"  
                                Text="View" />
                        </Columns>
                        <FooterStyle />
                        <PagerStyle />
                        <SelectedRowStyle />
                        <HeaderStyle CssClass="admin_gridheader" />
                        <EditRowStyle />
                        <AlternatingRowStyle CssClass="admin_gridodd" />
                        <RowStyle CssClass="admin_grideven" />
                    </asp:GridView>
                </div>
                <div id="divProposal" runat="server" class="w45p left pad_r20px">
                    <div class="left">
                        <span class="h">
                            <asp:Label ID="lblProposalHeader" runat="server" Text="User Completed Proposal Details"></asp:Label></span></div>
                    <br />
                    <div class="pad_r20px font_13px">
                        <asp:Label ID="lblProposalMessage" runat="server" Text="This option for CX Customer Users only."
                            Visible="false"></asp:Label></div>
                    <asp:GridView ID="grvProposalCount" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        CellPadding="2" CssClass="admin_gridstyle" EmptyDataText="There are no data records to display."
                        GridLines="None" Width="75%" DataKeyNames="RefCEUserId,InsType" OnRowDataBound="grvProposalCount_RowDataBound">
                        <FooterStyle />
                        <PagerStyle />
                        <Columns>
                            <asp:BoundField DataField="RefCEUserId" HeaderText="User ID" ReadOnly="True" />
                            <asp:BoundField DataField="InsType" HeaderText="Insurance Type" ReadOnly="True" />
                            <asp:BoundField DataField="ProposalCount" HeaderText="No of Proposal" />
                            <asp:HyperLinkField DataNavigateUrlFields="ProposalUrl" Target="_blank" HeaderText="View"  
                                Text="View" />
                        </Columns>
                        <FooterStyle />
                        <PagerStyle />
                        <SelectedRowStyle />
                        <HeaderStyle CssClass="admin_gridheader" />
                        <EditRowStyle />
                        <AlternatingRowStyle CssClass="admin_gridodd" />
                        <RowStyle CssClass="admin_grideven" />
                    </asp:GridView>
                    <div style="display: none;">
                        <asp:TextBox ID="txtCEID" runat="server" Text="0"></asp:TextBox>
                    </div>
                    <div class="pad_r20px font_13px">
                        <asp:HyperLink Visible="false" ID="hplView" NavigateUrl="" runat="server" Target="_blank" 
                            Text="View All Proposals" ToolTip="View All Proposals"></asp:HyperLink>
                    </div>
                </div>
            </td>
        </table>
    </div>

    <script type="text/javascript">
        function OpenProposal(refid) {
            var winl = (screen.width - 500) / 2;
            var wint = (screen.height - 300) / 2;
            var settings = 'height=300,';
            settings += 'width=500,';
            settings += 'top=' + wint + ',';
            settings += 'left=' + winl + ',';
            settings += 'scrollbars=yes,';
            settings += 'resizable=No';
            window.open('user-info.aspx?Ref=' + refid, 'NEWWIN', settings);
        }
    </script>

    <script type="text/javascript">
        function OpenNewWindow(url) {
            var settings = 'scrollbars=yes,';
            settings += 'resizable=No';
            window.open(url, 'NEWWIN', settings);
        }
    </script>

</asp:Content>

